This invention relates to a system and method for profiling the dynamic execution of a computer program, and more particularly to a system and method for creating a pictorial or diagrammatic representation of the dynamic execution of a computer program.
The efficiency of computer systems overall, and of individual computer programs or portions thereof in particular, is of great concern to those who write software and maintain computer systems. This is exemplified by the fact that computer hardware and software owners often view their computing resources, and the applications executing on them, as assets. Like many other assets, their owners seek to manage the assets such that the efficiency and productivity of these assets are maximized. The performance of any computer system is necessarily a function of the efficient utilization of the computer""s limited resources (e.g., processor usage, memory and I/O devices). Adjusting the allocation of the limited resources in the computer system in order to effectively manage the computing assets, also known as xe2x80x9ctuning,xe2x80x9d can result in more efficient utilization of these valuable resources and programs which execute faster and more efficiently.
The xe2x80x9cbehaviorxe2x80x9d of computer programs, that is, the dynamic, run-time execution and processing of a computer program, is often studied in detail. Understanding the behavior of a computer program facilitates tuning of the system and correction of run-time errors or other shortcomings. These errors may be the result of programming mistakes, or of unexpected and inefficient interaction between one or more programs (or one or more processes spawned by a single program) running simultaneously on the system.
The behavior of a computer program, and in particular the sequence of operations performed by the program, may vary considerably each time the program is run (each xe2x80x9cinstancexe2x80x9d of the program) even though the source code has not changed. The behavior of a program may vary from instance to instance based on input (received from a user or an I/O device, for example), data read by and operated on by the program, and the like. As a result of these variables, the sequence of operations performed by the program (known as xe2x80x9cpathsxe2x80x9d) may vary significantly from instance to instance. Further, as a result of such different paths being taken by the program, the performance of the program may vary from instance to instance, in some cases being satisfactory and in other cases being unsatisfactory. Moreover, the program may perform correctly when certain paths are taken, and the program may perform erroneously when other paths are taken. Even paths that perform correctly may follow a sequence not well understood by programmers maintaining the program, or even by its original developer.
These difficulties are compounded in larger programs, wherein the increased number of functions and subfunctions makes it less likely that the program""s internal workings will be fully understood. In such cases, it is likely that a xe2x80x9cresult-orientedxe2x80x9d approach will be taken by developers and maintenance personnel, by which the efficacy of the program is tested only by verifying the correctness of output from the program without fully understanding what the program is actually doing while executing, and in what manner the program is making use of system resources. A xe2x80x9cbehavioralxe2x80x9d approach to tuning and debugging, in which the programmer or maintainer understands the logical flow or behavior of programs during execution and use of the system""s resources, is better suited for developing programs and tuning systems to maximize the efficient use of resources while minimizing errors. However, a tool is needed to convey information about the behavior and performance of the program to the programmer or maintainer (the user of the tool) in a comprehensible and more easily graspable format.
Several types of programs have been developed which create pictorial representations, or profiles, of program performance. One type of profiling program monitors and profiles the overall performance of subject programs by simply gathering statistics on such things as I/O frequency and CPU utilization and by indexing this data by time period, type of I/O, etc.
A second type of profiling program profiles the performance of subject programs by collecting statistics related to individual instructions or ranges of instructions executed by the subject program. This second type of profiling program typically periodically interrupts the operation of the subject program and detects the instruction about to be performed by the subject program. This type of profiling program reports the relative frequency with which particular instructions or ranges of instructions are executed, and may also report on the CPU time consumed by those instructions. The report produced by this type of profiling program may consist of a bar chart with a bar for each instruction or instruction range, wherein the height of each bar denotes the frequency with which the subject program was found to be executing the instruction or range of instructions at issue when the subject program was interrupted.
A third type of profiling program, known as xe2x80x9cflow charting programs,xe2x80x9d processes the source code of a computer program directly and depicts it graphically, according to well-known conventions, so that the processing logic and flow can be more easily traced and understood.
While all of these types of profiling programs provide valuable information for systems and application programmers, the present art is deficient in that no program relates the run-time behavior and dynamic performance of a program to its logical flow. Therefore, it is desired to provide a computer program profiler which depicts the behavior of a computer program and relates the program""s behavior and performance to its logical flow in its operating environment, including multiprocessor and networked environments.
Generally speaking, in accordance with the invention a computer program profiler is provided which diagrammatically, pictorially and tabularly provides a user with data showing the behavior of a computer program such that the program""s behavior and performance is shown in accordance with its logical flow in its operating environment, including multiprocessor and networked environments. This allows owners and operators of the computers and networks executing the program to effectively and efficiently manage their computing and networking assets.
It is an object of the present invention to provide a method for profiling one or more operational characteristics of a computer program, the computer program performing one or more transactions, at least one of the transactions having one or more events in which data is gathered corresponding to one or more of the events. A path map is constructed from the gathered event data in which the path map represents program operation performance relationships between the gathered events, the path map being in execution-time sequence, and an output is created based on the path map.
Another object of the invention is to provide a method for analyzing at least one transaction of a computer program to determine the operational characteristics of the computer program, in which a plurality of data is gathered corresponding to one or more of a plurality of event data in a manner having approximately no impact on the executional performance of the computer program. An output is created based on the plurality of gathered event data.
According to still another object of the present invention, an apparatus for profiling one or more operational characteristics of a computer program is provided, the computer program performing one or more transactions, at least one of the transactions having one or more events in which the apparatus comprises a processor capable of the following functions:
gathering data corresponding to one or more of said plurality of events;
constructing a path map from the gathered event data, the path map representing program operation performance relationships between the gathered events, the path map being in execution-time sequence; and
creating an output based on the path map.
According to another object of the invention, a computer storage medium storing a first computer executable program code is provided which, when run, executes a method for profiling one or more operational characteristics of a second computer program, the second computer program performing one or more transactions each having a plurality of events, in which data is gathered corresponding to one or more of the plurality of events. A path map is constructed from the gathered event data, the path map representing program operation performance relationships between the gathered events, the path map being in execution-time sequence, and an output is created based on the path map.
Other features and advantages of the present invention will become apparent from the following description of the invention which refers to the accompanying drawings.